package com.agriculture.mapper;

import com.agriculture.entity.TblArea;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.agriculture.entity.AddressBook;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;

import java.util.List;

@Mapper
public interface AddressBookMapper extends BaseMapper<AddressBook> {
    @Select("select address_book.* from address_book, tbl_area " +
            "where address_book.area_code = tbl_area.area_code and address_book.id = #{id}")
    List<AddressBook> getAddById(Long id);

    @Select("select * from area where id = #{code}")
    List<TblArea> selectByCode(String code);

}
